(global.webpackJsonp = global.webpackJsonp || []).push([ [ "wjyk_recycle/pages/person-message/person-message" ], {
    "029a": function(t, e, n) {
        n.r(e);
        var o, a = n("276d"), i = n.n(a);
        for (o in a) "default" !== o && function(t) {
            n.d(e, t, function() {
                return a[t];
            });
        }(o);
        e.default = i.a;
    },
    "23d7": function(t, e, n) {
        var o = n("a60c");
        n.n(o).a;
    },
    "276d": function(t, i, r) {
        (function(o) {
            Object.defineProperty(i, "__esModule", {
                value: !0
            }), i.default = void 0;
            var t, a = (t = r("4795")) && t.__esModule ? t : {
                default: t
            };
            function c(t, e, n, o, a, i, r) {
                try {
                    var s = t[i](r), c = s.value;
                } catch (t) {
                    return n(t), 0;
                }
                s.done ? e(c) : Promise.resolve(c).then(o, a);
            }
            function e(s) {
                return function() {
                    var t = this, r = arguments;
                    return new Promise(function(e, n) {
                        var o = s.apply(t, r);
                        function a(t) {
                            c(o, e, n, a, i, "next", t);
                        }
                        function i(t) {
                            c(o, e, n, a, i, "throw", t);
                        }
                        a(void 0);
                    });
                };
            }
            var n = {
                data: function() {
                    return {
                        name: "",
                        input_code: "",
                        telphone: "",
                        detail: "",
                        code: "",
                        title: "获取验证码",
                        timer: 60,
                        disabled: !1,
                        region: [ "", "", "" ],
                        province: "",
                        city: "",
                        county: "",
                        is_open: null
                    };
                },
                onLoad: function() {
                    this.user(), this.systems();
                },
                methods: {
                    bindPickerChange: function(t) {
                        console.log("picker发送选择改变，携带值为", t, t.target.value), this.region[0] = t.target.value[0], 
                        this.region[1] = t.target.value[1], this.region[2] = t.target.value[2], this.province = t.target.value[0], 
                        this.city = t.target.value[1], this.county = t.target.value[2];
                    },
                    save: function() {
                        return this.name ? this.telphone ? /^1[3456789]\d{9}$/.test(this.telphone) ? this.input_code || 1 != this.is_open ? this.input_code != this.code && 1 == this.is_open ? (this.showToast("验证码错误"), 
                        !1) : this.province ? this.detail ? (console.log("提交成功"), this.update(), void console.log("点击了保存", -1 == this.name.indexOf(" "), this.name, this.telphone, this.code, this.province, this.detail)) : (this.showToast("详细地址不能为空"), 
                        !1) : (this.showToast("请选择收货地址"), !1) : (this.showToast("请输入验证码"), !1) : (this.showToast("请输入正确的手机号码"), 
                        !1) : (this.showToast("手机号码不能为空"), !1) : (this.showToast("姓名不能为空"), !1);
                    },
                    showToast: function(t) {
                        o.showToast({
                            title: t,
                            duration: 1e3,
                            icon: "none"
                        });
                    },
                    getVal: function(t) {
                        t = t.detail.value;
                        console.log("phone", t), this.data.telphone = t;
                    },
                    getCode: function() {
                        var t = this;
                        console.log("++++++++", this.telphone);
                        var e = !0;
                        if (this.disabled) console.log("重复点击"); else {
                            if (!/^1[3456789]\d{9}$/.test(this.telphone)) return void wx.showToast({
                                title: "请输入正确的手机号码",
                                icon: "none"
                            });
                            this.disabled = !0;
                            var n = setInterval(function() {
                                if (t.timer--, t.title = t.timer + "s后重新发送", 0 == t.timer) return clearInterval(n), 
                                t.title = "获取验证码", t.disabled = !1, void (t.timer = 60);
                            }, 1e3);
                        }
                        e && this.sendMobile();
                    },
                    sendMobile: function() {
                        var n = this;
                        return e(a.default.mark(function t() {
                            var e;
                            return a.default.wrap(function(t) {
                                for (;;) switch (t.prev = t.next) {
                                  case 0:
                                    return t.next = 2, n.$http({
                                        url: n.$api.sendMobile,
                                        data: {
                                            telphone: n.telphone
                                        }
                                    });

                                  case 2:
                                    e = t.sent, console.log("发送验证码成功", e), 0 == e.errno && (console.log("验证码", e, e.data), 
                                    n.code = e.data);

                                  case 5:
                                  case "end":
                                    return t.stop();
                                }
                            }, t);
                        }))();
                    },
                    update: function() {
                        var n = this;
                        return e(a.default.mark(function t() {
                            var e;
                            return a.default.wrap(function(t) {
                                for (;;) switch (t.prev = t.next) {
                                  case 0:
                                    return t.next = 2, n.$http({
                                        url: n.$api.update,
                                        data: {
                                            uid: o.getStorageSync("uid"),
                                            realname: n.name,
                                            telphone: n.telphone,
                                            province: n.province,
                                            city: n.city,
                                            county: n.county,
                                            detail: n.detail
                                        }
                                    });

                                  case 2:
                                    e = t.sent, console.log("发送验证码成功", e), 0 == e.errno && o.showModal({
                                        title: "提示",
                                        showCancel: !1,
                                        content: e.message,
                                        success: function(t) {
                                            if (t.confirm) o.navigateBack({
                                                delta: 1
                                            }); else if (t.cancel) return;
                                        }
                                    });

                                  case 5:
                                  case "end":
                                    return t.stop();
                                }
                            }, t);
                        }))();
                    },
                    user: function() {
                        var n = this;
                        return e(a.default.mark(function t() {
                            var e;
                            return a.default.wrap(function(t) {
                                for (;;) switch (t.prev = t.next) {
                                  case 0:
                                    return t.next = 2, n.$http({
                                        url: n.$api.user,
                                        data: {
                                            uid: o.getStorageSync("uid")
                                        }
                                    });

                                  case 2:
                                    0 == (e = t.sent).errno && (n.name = e.data.realname, n.telphone = e.data.telphone, 
                                    n.province = e.data.province, n.city = e.data.city, n.county = e.data.county, n.detail = e.data.detail, 
                                    n.region[0] = e.data.province, n.region[1] = e.data.city, n.region[2] = e.data.county), 
                                    console.log("用户信息", e, n.province, n.region[0]);

                                  case 5:
                                  case "end":
                                    return t.stop();
                                }
                            }, t);
                        }))();
                    },
                    systems: function() {
                        var n = this;
                        return e(a.default.mark(function t() {
                            var e;
                            return a.default.wrap(function(t) {
                                for (;;) switch (t.prev = t.next) {
                                  case 0:
                                    return t.next = 2, n.$http({
                                        url: n.$api.system
                                    });

                                  case 2:
                                    0 == (e = t.sent).errno && (console.log("系统设置", e), n.is_open = e.data.is_open);

                                  case 4:
                                  case "end":
                                    return t.stop();
                                }
                            }, t);
                        }))();
                    }
                }
            };
            i.default = n;
        }).call(this, r("543d").default);
    },
    "2f9b": function(t, e, n) {
        n.r(e);
        var o, a = n("c705"), i = n("029a");
        for (o in i) "default" !== o && function(t) {
            n.d(e, t, function() {
                return i[t];
            });
        }(o);
        n("23d7");
        var r = n("f0c5"), a = Object(r.a)(i.default, a.b, a.c, !1, null, null, null, !1, a.a, void 0);
        e.default = a.exports;
    },
    a482: function(t, e, n) {
        (function(t) {
            function e(t) {
                return t && t.__esModule ? t : {
                    default: t
                };
            }
            n("8163"), e(n("66fd")), t(e(n("2f9b")).default);
        }).call(this, n("543d").createPage);
    },
    a60c: function(t, e, n) {},
    c705: function(t, e, n) {
        function o() {
            this.$createElement, this._self._c;
        }
        var a = [];
        n.d(e, "b", function() {
            return o;
        }), n.d(e, "c", function() {
            return a;
        }), n.d(e, "a", function() {});
    }
}, [ [ "a482", "common/runtime", "common/vendor" ] ] ]);